<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aimath_basic.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('aimath__basic_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">aimath_basic.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Basic data-type independent math operations.  
<a href="#details">More...</a></p>

<p><a href="aimath__basic_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab10c8d06990943806f0be8fcc6af03fc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">print_aitensor</a> (const <a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:ab10c8d06990943806f0be8fcc6af03fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Printing a tensor to console.  <a href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">More...</a><br /></td></tr>
<tr class="separator:ab10c8d06990943806f0be8fcc6af03fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa9ca757028820849ef3dde13cc46565"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a> (const void *scalar, const <a class="el" href="structaimath__dtype.html">aimath_dtype_t</a> *dtype)</td></tr>
<tr class="memdesc:aaa9ca757028820849ef3dde13cc46565"><td class="mdescLeft">&#160;</td><td class="mdescRight">Printing a scalar to console.  <a href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">More...</a><br /></td></tr>
<tr class="separator:aaa9ca757028820849ef3dde13cc46565"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2493f76ff7bca07ccfce567c2e678ece"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#a2493f76ff7bca07ccfce567c2e678ece">aimath_transpose_vector</a> (<a class="el" href="structaitensor.html">aitensor_t</a> *vector)</td></tr>
<tr class="memdesc:a2493f76ff7bca07ccfce567c2e678ece"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transposes a vector.  <a href="aimath__basic_8h.html#a2493f76ff7bca07ccfce567c2e678ece">More...</a><br /></td></tr>
<tr class="separator:a2493f76ff7bca07ccfce567c2e678ece"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af298fd08e5d0e8182aac03c34dcbfbc0"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#af298fd08e5d0e8182aac03c34dcbfbc0">aimath_tensor_elements</a> (const <a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:af298fd08e5d0e8182aac03c34dcbfbc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the number of elements in a tensor.  <a href="aimath__basic_8h.html#af298fd08e5d0e8182aac03c34dcbfbc0">More...</a><br /></td></tr>
<tr class="separator:af298fd08e5d0e8182aac03c34dcbfbc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb2e8e78c254bba409ca94b989fb0aed"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#adb2e8e78c254bba409ca94b989fb0aed">aimath_sizeof_dtype</a> (const <a class="el" href="structaimath__dtype.html">aimath_dtype_t</a> *dtype)</td></tr>
<tr class="memdesc:adb2e8e78c254bba409ca94b989fb0aed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the size of one value in the given data type in bytes.  <a href="aimath__basic_8h.html#adb2e8e78c254bba409ca94b989fb0aed">More...</a><br /></td></tr>
<tr class="separator:adb2e8e78c254bba409ca94b989fb0aed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed334e3dae9f383fde9c43e99872c745"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#aed334e3dae9f383fde9c43e99872c745">aimath_sizeof_tensor_data</a> (const <a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:aed334e3dae9f383fde9c43e99872c745"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns size of the data array of the tensor in bytes.  <a href="aimath__basic_8h.html#aed334e3dae9f383fde9c43e99872c745">More...</a><br /></td></tr>
<tr class="separator:aed334e3dae9f383fde9c43e99872c745"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afe922f577551340a7d559c3a722baa69"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#afe922f577551340a7d559c3a722baa69">aimath_sizeof_tensor_params</a> (const <a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:afe922f577551340a7d559c3a722baa69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns size of the <a class="el" href="structaitensor.html#ab615dd1ddcc27064097dd98cbc7fe9a0" title="Parameters to describe some data properties (for example quantization parameters like zero_point and ...">aitensor.tensor_params</a> for the data type of the tensor.  <a href="aimath__basic_8h.html#afe922f577551340a7d559c3a722baa69">More...</a><br /></td></tr>
<tr class="separator:afe922f577551340a7d559c3a722baa69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47674c7536683118f1fa711c3c5c883e"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aimath__basic_8h.html#a47674c7536683118f1fa711c3c5c883e">aimath_sizeof_tensor</a> (const <a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:a47674c7536683118f1fa711c3c5c883e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns size of tensor in bytes.  <a href="aimath__basic_8h.html#a47674c7536683118f1fa711c3c5c883e">More...</a><br /></td></tr>
<tr class="separator:a47674c7536683118f1fa711c3c5c883e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Basic data-type independent math operations. </p>
<dl class="section version"><dt>Version</dt><dd>2.2.0 </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2020-2023 Fraunhofer Institute for Microelectronic Circuits and Systems. All rights reserved.<br  />
<br  />
 AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br  />
<br  />
 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.<br  />
<br  />
 You should have received a copy of the GNU Affero General Public License along with this program. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>. </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="adb2e8e78c254bba409ca94b989fb0aed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb2e8e78c254bba409ca94b989fb0aed">&#9670;&nbsp;</a></span>aimath_sizeof_dtype()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aimath_sizeof_dtype </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaimath__dtype.html">aimath_dtype_t</a> *&#160;</td>
          <td class="paramname"><em>dtype</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the size of one value in the given data type in bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*dtype</td><td>The data type to get the size of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Size of one value in the given data type in bytes </dd></dl>

</div>
</div>
<a id="a47674c7536683118f1fa711c3c5c883e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47674c7536683118f1fa711c3c5c883e">&#9670;&nbsp;</a></span>aimath_sizeof_tensor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aimath_sizeof_tensor </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>tensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns size of tensor in bytes. </p>
<p>The size is calculated by:</p>
<div class="fragment"><div class="line"><span class="keyword">sizeof</span>(<a class="code" href="structaitensor.html">aitensor_t</a>) + <a class="code" href="aimath__basic_8h.html#aed334e3dae9f383fde9c43e99872c745">aimath_sizeof_tensor_data</a>(tensor) + <a class="code" href="aimath__basic_8h.html#afe922f577551340a7d559c3a722baa69">aimath_sizeof_tensor_params</a>(tensor) </div>
<div class="ttc" id="aaimath__basic_8h_html_aed334e3dae9f383fde9c43e99872c745"><div class="ttname"><a href="aimath__basic_8h.html#aed334e3dae9f383fde9c43e99872c745">aimath_sizeof_tensor_data</a></div><div class="ttdeci">uint32_t aimath_sizeof_tensor_data(const aitensor_t *tensor)</div><div class="ttdoc">Returns size of the data array of the tensor in bytes.</div></div>
<div class="ttc" id="aaimath__basic_8h_html_afe922f577551340a7d559c3a722baa69"><div class="ttname"><a href="aimath__basic_8h.html#afe922f577551340a7d559c3a722baa69">aimath_sizeof_tensor_params</a></div><div class="ttdeci">uint32_t aimath_sizeof_tensor_params(const aitensor_t *tensor)</div><div class="ttdoc">Returns size of the aitensor.tensor_params for the data type of the tensor.</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*tensor</td><td>The tensor to get the size of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Size of tensor in bytes </dd></dl>

</div>
</div>
<a id="aed334e3dae9f383fde9c43e99872c745"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed334e3dae9f383fde9c43e99872c745">&#9670;&nbsp;</a></span>aimath_sizeof_tensor_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aimath_sizeof_tensor_data </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>tensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns size of the data array of the tensor in bytes. </p>
<p>The size is calculated by:</p>
<div class="fragment"><div class="line"><a class="code" href="aimath__basic_8h.html#af298fd08e5d0e8182aac03c34dcbfbc0">aimath_tensor_elements</a>(tensor) * <a class="code" href="aimath__basic_8h.html#adb2e8e78c254bba409ca94b989fb0aed">aimath_sizeof_dtype</a>(tensor.dtype) </div>
<div class="ttc" id="aaimath__basic_8h_html_adb2e8e78c254bba409ca94b989fb0aed"><div class="ttname"><a href="aimath__basic_8h.html#adb2e8e78c254bba409ca94b989fb0aed">aimath_sizeof_dtype</a></div><div class="ttdeci">uint32_t aimath_sizeof_dtype(const aimath_dtype_t *dtype)</div><div class="ttdoc">Returns the size of one value in the given data type in bytes.</div></div>
<div class="ttc" id="aaimath__basic_8h_html_af298fd08e5d0e8182aac03c34dcbfbc0"><div class="ttname"><a href="aimath__basic_8h.html#af298fd08e5d0e8182aac03c34dcbfbc0">aimath_tensor_elements</a></div><div class="ttdeci">uint32_t aimath_tensor_elements(const aitensor_t *tensor)</div><div class="ttdoc">Calculates the number of elements in a tensor.</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*tensor</td><td>The tensor to get the data size of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Size of tensor data in bytes </dd></dl>

</div>
</div>
<a id="afe922f577551340a7d559c3a722baa69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afe922f577551340a7d559c3a722baa69">&#9670;&nbsp;</a></span>aimath_sizeof_tensor_params()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aimath_sizeof_tensor_params </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>tensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns size of the <a class="el" href="structaitensor.html#ab615dd1ddcc27064097dd98cbc7fe9a0" title="Parameters to describe some data properties (for example quantization parameters like zero_point and ...">aitensor.tensor_params</a> for the data type of the tensor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*tensor</td><td>The tensor to get the parameters size of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Size of tensor parameters in bytes </dd></dl>

</div>
</div>
<a id="af298fd08e5d0e8182aac03c34dcbfbc0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af298fd08e5d0e8182aac03c34dcbfbc0">&#9670;&nbsp;</a></span>aimath_tensor_elements()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aimath_tensor_elements </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>tensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculates the number of elements in a tensor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*tensor</td><td>The tensor to count the elements of </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of elements in tensor </dd></dl>

</div>
</div>
<a id="a2493f76ff7bca07ccfce567c2e678ece"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2493f76ff7bca07ccfce567c2e678ece">&#9670;&nbsp;</a></span>aimath_transpose_vector()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aimath_transpose_vector </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>vector</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Transposes a vector. </p>
<p class="formulaDsp">
\[ vector \leftarrow vector^T \]
</p>
<p>Make sure that the given tensor is a vector (with shape [1 x N] or [N x 1])</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*vector</td><td>The vector to transpose (2D tensor of shape [1 x N] or [N x 1]) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aaa9ca757028820849ef3dde13cc46565"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa9ca757028820849ef3dde13cc46565">&#9670;&nbsp;</a></span>print_aiscalar()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void print_aiscalar </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>scalar</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structaimath__dtype.html">aimath_dtype_t</a> *&#160;</td>
          <td class="paramname"><em>dtype</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Printing a scalar to console. </p>
<p>Calls the corresponding print function of the used <a class="el" href="structaimath__dtype.html" title="Indicator for the used datatype.">aimath_dtype</a>.</p>
<p>Example: </p><div class="fragment"><div class="line"><a class="code" href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a> scalar = 42.0f;</div>
<div class="line"> </div>
<div class="line"><a class="code" href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a>(&amp;scalar, <a class="code" href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a>);</div>
<div class="ttc" id="aaimath__basic_8h_html_aaa9ca757028820849ef3dde13cc46565"><div class="ttname"><a href="aimath__basic_8h.html#aaa9ca757028820849ef3dde13cc46565">print_aiscalar</a></div><div class="ttdeci">void print_aiscalar(const void *scalar, const aimath_dtype_t *dtype)</div><div class="ttdoc">Printing a scalar to console.</div></div>
<div class="ttc" id="aaimath__f32_8h_html_a06eea7384624233f57daab2648d8ce37"><div class="ttname"><a href="aimath__f32_8h.html#a06eea7384624233f57daab2648d8ce37">aif32</a></div><div class="ttdeci">const aimath_dtype_t * aif32</div><div class="ttdoc">The F32 data-type indicator.</div></div>
<div class="ttc" id="aaimath__f32_8h_html_ad3ffba87614778a1d8ee2314117ff59c"><div class="ttname"><a href="aimath__f32_8h.html#ad3ffba87614778a1d8ee2314117ff59c">aiscalar_f32_t</a></div><div class="ttdeci">float aiscalar_f32_t</div><div class="ttdoc">Scalar for F32 (aif32) data-type.</div><div class="ttdef"><b>Definition:</b> aimath_f32.h:120</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*scalar</td><td>The scalar to print. </td></tr>
    <tr><td class="paramname">*dtype</td><td>The data type of the scalar </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab10c8d06990943806f0be8fcc6af03fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab10c8d06990943806f0be8fcc6af03fc">&#9670;&nbsp;</a></span>print_aitensor()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void print_aitensor </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>tensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Printing a tensor to console. </p>
<p>Calls the corresponding print function of the used <a class="el" href="structaimath__dtype.html" title="Indicator for the used datatype.">aimath_dtype</a>.</p>
<p>Example: </p><div class="fragment"><div class="line">uint16_t tensor_shape[2] = {2, 3};</div>
<div class="line"><span class="keywordtype">float</span> tensor_data[2*3] = {1.0f, 2.0f, 3.0f,</div>
<div class="line">                          4.0f, 5.0f, 6.0f};</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> tensor = AITENSOR_2D_F32(tensor_shape, tensor_data);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">print_aitensor</a>(&amp;tensor);</div>
<div class="ttc" id="aaimath__basic_8h_html_ab10c8d06990943806f0be8fcc6af03fc"><div class="ttname"><a href="aimath__basic_8h.html#ab10c8d06990943806f0be8fcc6af03fc">print_aitensor</a></div><div class="ttdeci">void print_aitensor(const aitensor_t *tensor)</div><div class="ttdoc">Printing a tensor to console.</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*tensor</td><td>The tensor to print. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_1e5d3661ed79af157d57e64a38265d09.html">basic</a></li><li class="navelem"><a class="el" href="dir_90008ee2b0f86999412b56217da88d54.html">base</a></li><li class="navelem"><a class="el" href="dir_4fb15a30b37b64fdad6823e3082f73a4.html">aimath</a></li><li class="navelem"><a class="el" href="aimath__basic_8h.html">aimath_basic.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
